//
//  USAlbumCell.m
//  us
//
//  Created by karry on 2025/4/10.
//

#import "USAlbumCell.h"


@implementation USAlbumCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self setupView];
    }
    return self;
}

- (void)setupView{
    USAlbumCoverView *coverView = [[USAlbumCoverView alloc]initWithFrame:self.bounds];
    _coverView = coverView;
    [self.contentView addSubview:coverView];
    [coverView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(0);
    }];
}

- (void)setSelected:(BOOL)selected{
    [super setSelected:selected];
    if (!self.seletedActive) {
        return;
    }
    
    [UIView animateWithDuration:0.2 animations:^{
        if (selected) {
            self.coverView.transform = CGAffineTransformMakeTranslation(0, -10);
        }else{
            self.coverView.transform = CGAffineTransformIdentity;
        }
    }];
    
}

@end
